
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.EvtStatisticDepartmentDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class EvtStatisticDepartmentDaoJdbc extends BaseDaoJdbc implements EvtStatisticDepartmentDao {
	String tableName="T_EVT_STATISTIC_DEPARTMENT";
	String beanName="evtStatisticDepartment";
	
	public CommonBean createEvtStatisticDepartment(){
		CommonBean evtStatisticDepartments=this.createBean(tableName,beanName);
                return evtStatisticDepartments;		
	}
	
/*
	public CommonBean findEvtStatisticDepartments(String refid) {
		CommonBean evtStatisticDepartments=this.createEvtStatisticDepartment();
		String sql="select * from T_EVT_STATISTIC_DEPARTMENT where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		evtStatisticDepartments.addData(data);
                return evtStatisticDepartments;
       }
*/
	public CommonBean findEvtStatisticDepartmentById(String id) {
		CommonBean evtStatisticDepartments=this.createEvtStatisticDepartment();
		String sql="select * from T_EVT_STATISTIC_DEPARTMENT where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		evtStatisticDepartments.addData(data);
    return evtStatisticDepartments;
  }
  
	public CommonBean findAllEvtStatisticDepartments() {
		CommonBean evtStatisticDepartments=this.createEvtStatisticDepartment();
		String sql="select * from T_EVT_STATISTIC_DEPARTMENT ";
		List data=this.getCommonDao().select(sql,new String[]{});
		evtStatisticDepartments.addData(data);
    return evtStatisticDepartments;
  }
	public void insertEvtStatisticDepartment(CommonBean evtStatisticDepartmentBean){
		List data=evtStatisticDepartmentBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
	public void updateEvtStatisticDepartment(CommonBean evtStatisticDepartmentBean){
		List data=evtStatisticDepartmentBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchUpdate(row,data);
	}
}

